{% extends "!layout.html" %}

{% block footer %}
{{ super() }}
<script type="text/javascript">
window.onload = function(e) {
    // Make our collapseindex elements actually collapsible
    $('<span class="collapsindextitle">Index</span> <a class="showhide">[show]</a>').insertBefore('.collapseindex');
    $('.showhide').each(function(index, value){
        var showHide = $(this);
        showHide.click(function() {
            if (this.innerHTML == "[hide]") {
                this.innerHTML = "[show]";
            } else {
                this.innerHTML = "[hide]";
            }
            $(this).next('.collapseindex').toggle(1); // This should always be the next .collapseindex element
        });
    });
    $('.collapseindex').each(function(index, value){
        // Start them out hidden
        $(this).hide();
    });
}
</script>
{% endblock %}